def deco(func):
    def wrapper(*args, **kwargs):
        obj = func(*args, **kwargs)
        return obj

    return wrapper


@deco  # foo = deco(foo)返回wrapper即wrapper的内存地址,foo= <function deco.<locals>.wrapper at 0x000000D60D9E2D90>
def foo(name, age):
    print(name)
    print(age)
    return name + str(age)


r = foo("yang", 19)  # 执行时,执行了wrapper函数 foo:<function deco.<locals>.wrapper at 0x000000D60D9E2D90>
print(r)

#结果:
# yang
# 19
# yang19
